#include<iostream>
#include<vector>
/*
using namespace std;

int longestOnes(vector<int>& nums, int k) {
    int ret = 0;
    for (int left = 0, right = 0, count = 0; right < nums.size(); right++)
    {
        if (nums[right] == 0)count++;
        while (count > k)
            if (nums[left++] == 0)count--;
        ret = max(ret, right - left + 1);
    }
    return ret;

}


int main()
{
    vector<int> a{ 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0 };
    cout << longestOnes(a, 2);

	return 0;
}*/